package config

import (
	"github.com/spf13/viper"
	"inspector/pkg/log"
)

type AtomConfig struct {
	BaseUrl        string `mapstructure:"base-url"`
	BaseApiUrl     string `mapstructure:"base-api-url"`
	AppId          string `mapstructure:"app-id"`
	AppName        string `mapstructure:"app-name"`
	ClientId       string `mapstructure:"client-id"`
	ClientSecrets  string `mapstructure:"client-secrets"`
	ApiKey         string `mapstructure:"api-key"`
	WebhookSecrets string `mapstructure:"webhook-secrets"`
	ScanUrl        string `mapstructure:"scan-url"`
}

var atomConfig AtomConfig

func initAtomConfig(v *viper.Viper) {
	err := v.Sub("atom").Unmarshal(&atomConfig)
	if err != nil {
		log.Error(err.Error())
	}
}

func (c *Config) GetAtomConfig() AtomConfig {
	return atomConfig
}
